AThis problem only occurs when there is a handoff (secondary) endpoint involved. The implementation of Open Transport makes it possible for an asynchronous handoff endpoint to receive a T_DATA event before the connect mechanism is completed. After accepting a connection, an asynchronous listener endpoint can expect to receive a T_ACCEPTCOMPLETE call. The "accepting" or handoff endpoint can expect to receive the T_PASSCON event.
It is possible for the handoff endpoint to receive the T_DATA event before receiving the T_PASSCON event. If this happens, set a flag to defer receiving the data until later. When the T_PASSCON event is received, check the flag and issue the OTRcv call if the flag is set. (Note that after deferring the handling of the T_DATA event, your handler will not be notified with this event, until you process (read) all of the data presently available.)